</body>
</html>
<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <script src="https://unpkg.com/vue@3"></script>
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <div id="app">
   
        <input v-model="message" placeholder="" />
        <button @click="submit">添加</button>
        <li v-for="index in lists">
            {{index.message}}
        </li>
    </div>
    <script>
        const { createApp } = Vue
     
        createApp({
          data() {
            return {
              message:'',
              lists:[]
            }
          },
          methods:{
              submit(){
                  console.log(this.lists)
                  this.lists.push({"message": this.message});
                  this.message=""
                 
              }
          }
     
        }).mount('#app')
      </script>
</body>
</html>